package revontuli.aMHD;

import revontuli.aMHD.datamanagement.DataManager;
import revontuli.aMHD.datamanagement.HTTPRetriever;
import android.app.Application;

public class aMHDApp extends Application {
	public static final String TAG = "aMHD";
	public static final boolean DEBUG = false;
	
	//spravy na komunikaciu medzi aktivitami a gps sluzbou
	public static final int MSG_REFRESH_GPS = 1;
	
	//konstanty aplikacie
	public static final int DAYTYPE_WORKDAY = 1;
	public static final int DAYTYPE_VACATIONWORKDAY = 2;
	public static final int DAYTYPE_HOLIDAY = 3;
	
	public static final int VEHICLE_BUS = 1;
	public static final int VEHICLE_TROLLEY = 2;
	public static final int VEHICLE_TRAM = 3;
	public static final int VEHICLE_TROLLEY_BUS = 4;
	public static final int VEHICLE_REGIONAL = 5;
	public static final int VEHICLE_NIGHT = 6;

	public static final int MIN_SEARCH_RANGE = 50;
	public static final int MAX_SEARCH_RANGE = 1000;
	public static final int ADDITIONAL_SEARCH_RANGE = 20;
	
	public static final String DATA_SERVER_URL = "http://mhd.gurnik.sk/";
	public static final String DATA_STOPLIST_UPDATE_PREFIX = "StopListUpdate.php?rev="; //pripojime cislo revizie
	public static final String DATA_LINELIST_UPDATE_PREFIX = "LineListUpdate.php?rev="; //pripojime cislo revizie
	public static final String DATA_LINEDEPART_UPDATE_PREFIX = "LineDepartUpdate.php?rev=%rev&line=%line";
	public static final String DATA_LINESTOPDEPART_PREFIX = "LineStopDepart.php?line=%1&stop=%2";
	public static final int DATA_TYPE_STOP = 1;
	public static final int DATA_TYPE_LINE = 2;
	
	public static DataManager mDataManager;
	public static HTTPRetriever mHTTPRetriever; //vytvori sa, ked bude treba
	
	@Override
	public void onCreate() {
		mDataManager = new DataManager(this);
	}
	
	public HTTPRetriever getRetriever() {
		if (mHTTPRetriever == null) {
			mHTTPRetriever = new HTTPRetriever();
		}
		return mHTTPRetriever;
	}
}
